let str: string | undefined;
console.log("str:", str);

function fn(date?: string) {
  if (date) {
    date.toString();
  }
}
// 不同与可选参数类型，这样写需要明确只能实参
// function fn(date: string | undefined) {}

fn();

// undefined, any, unknown三种类型可以接受 undefined
// null, any, unknown三种类型可以接受 null
let data: undefined = undefined;
let date1: any = undefined;
let date2: unknown = undefined;

export {};
